﻿using System;
using System.Threading;
namespace program14
{
    /// <summary>
    /// 最基本的线程控制
    /// </summary>
    class Program
    {
        static void Main(string[] args)
        {
            //先暂停执行3秒钟
            //Thread.Sleep(3000);
            //Console.WriteLine("Hello World!");

            Program thread1 = new Program();
            thread1.Method();

            ThreadStart ts = new ThreadStart(thread1.Method);
            Thread t = new Thread(ts);
        }
        public void Method()
        {
            int i = 1;
            int j = 2;
            int result = i + j;
            Console.WriteLine("线程：{0}计算结果：{1}", AppDomain.GetCurrentThreadId().ToString(),result);
                }
    }
}
